//
//  WelfareListCell.m
//  jingjing2.0
//
//  Created by apple on 16/5/3.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "WelfareListCell.h"
#import "ColorfulEggViewController.h"
#import "PinDanViewController.h"
#import "InviteViewController.h"
#import "BusinessWelfareViewController.h"
#import "HomeViewController.h"
@implementation WelfareListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)clickOnButton:(id)sender {
    CustomButton *btn=sender;
    HomeViewController *home=(HomeViewController *)_delegate;
    if ([btn.title isEqualToString:@"彩蛋"]) {
        ColorfulEggViewController *egg=[[ColorfulEggViewController alloc]init];
        egg.title=@"彩蛋";
        egg.hidesBottomBarWhenPushed=YES;
        [home.navigationController pushViewController:egg animated:YES];
        
    }else if ([btn.title isEqualToString:@"拼单"])
    {
        PinDanViewController *pindan=[[PinDanViewController alloc]init];
        pindan.hidesBottomBarWhenPushed=YES;
        [home.navigationController pushViewController:pindan animated:YES];

    }else if ([btn.title isEqualToString:@"邀请返利"])
    {
        InviteViewController *invite=[[InviteViewController alloc]init];
        invite.title=@"净净洗衣邀请返利";
        invite.categoryID=[NSString stringWithFormat:@"%ld",btn.tag];
        invite.hidesBottomBarWhenPushed=YES;
        [home.navigationController pushViewController:invite animated:YES];

    }else
    {
        BusinessWelfareViewController *bussiness=[[BusinessWelfareViewController alloc]init];
        bussiness.hidesBottomBarWhenPushed=YES;
        
        [home.navigationController pushViewController:bussiness animated:YES];
    }
}
@end
